﻿// -------------------------------------------------------------------------
//    @FileName         :    NFBattleActor.h
//    @Author           :    gaoyi
//    @Date             :    2025-02-27
//    @Email			:    445267987@qq.com
//    @Module           :    NFBattleActor
//
// -------------------------------------------------------------------------

#pragma once

#include <NFEntity.h>
#include "NFBattleCommonDefine.h"
#include "proto_battle.nanopb.h"
#include "proto_common_base.nanopb.h"
#include "proto_common_enum.nanopb.h"
#include "proto_common_team.pb.h"

class NFBattleActor : public NFEntity
{
public:
    NFBattleActor();

    ~NFBattleActor() override;

    int CreateInit();

    int ResumeInit();
protected:
    bool m_bValid;               //为true表示正常的actor, 为false时表示无效的actor(需要在下一帧删除)
    bool m_bRunning;             //为true表示actor在跑动中(客户端驱动)
    bool m_bDisappear;           //为true表示actor在消失(隐藏)状态
    bool m_bSyncFixGroundFlag;   //为true表示actor需要贴地(客户端用)
    bool m_bForceStopAI;         //为true表示actor的AI不会tick
    bool m_bNeedSpawn;           //为true表示actor在隐藏状态且不会tick
    bool m_bStartFight;          //为true表示actor在战斗中(目前用来给伙伴用, 一个玩家有多个伙伴时用来标示战斗中的伙伴)
    bool m_bInHate;              //为true表示actor能被寻敌找到(需m_bUseLocalHate为true此字段才生效)
    bool m_bUseLocalHate;        //为true表示actor使用m_bInHate字段标示是否能被加入仇恨列表,否则使用actor本身配置
    bool m_bThroughAirwall;      //为true表示actor可以穿越空气墙(移动时候不会检测空气墙,此标示也会传给客户端)
    bool m_bIsPrintClientDamage;
    bool m_bIsPrintClientInjury;
    bool m_bAbyss;
    bool m_bEntranceActionFinish;
    bool m_bReverseDmg;
    bool m_bCopy;
    bool m_bSummon;

    int m_iBattleID;             //所处战斗的GlobalID()
    int m_iDescID;               //actor的配置表ID
    int m_iCopyDescID;
    int m_iMapDescID;            //所处地图的配置表ID.
    int m_iMapInstID;            //所处地图的GlobalID()
    int m_iJobID;                //职业ID
    int m_iSpawnGroupID;         //刷怪的GroupID(只有通过地编刷的才会有)
    int m_iSpawnOneID;
    int m_iStrongID;
    int m_iNameInEditor;
    int m_iLevelInEditor;
    int m_iOwnerID;
    int m_iProgressMgrID;
    int m_iBeginHit;
    int m_iEntranceMode;
    int m_iLastAction;
    int m_iStartFrame;
    int m_iCountNum;
    int m_iHostGroupID;

    int m_resourceCount[proto_ff::enTeamPlayerGetResourceType_MAX];
    int m_iAIParam[MAX_AI_MAP_PARAM];

    uint64_t m_ullMainID;
    uint64_t m_ullBeenHitTime;
    uint64_t m_ullLastTriggerNotHurtTime;
    uint64_t m_ullStartRunTime;
    uint64_t m_ullLastTriggerKeepRunningTime;
    uint64_t m_ullStopRunTime;
    uint64_t m_ullSpawnTime;
    uint64_t m_ullRealSpawnTime;
    uint64_t m_ullStartFightTime;
    uint64_t m_ullSumFightTime;
    uint64_t m_ullRevocerPabodyTime;
    uint64_t m_ullLastUpdateHostTime;

    uint32_t m_uiRandomNum;

    ActorObjType      m_eType;
    enCampType        m_eCampID;
    enLevelMode       m_eMode;
    enComputerAILevel m_eAILevel;

    char m_szAIFileName[MAX_AI_FILE_NAME_LEN];
    char m_sBornActionLabel[MAX_ACTION_NAME_LEN + 1];

    Proto_Vector3 m_stBornOriginalPos;
};
